Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move chroot from multus main process to its child processes #1161

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

pliurh
Copy link
Contributor

@pliurh pliurh commented Sep 21, 2023

We used to run chroot in multus main process when calling other CNI plugin binary. We also use a mutex to lock the access to pod files. But this causes performance issues when facing heavy CNI_ADD/CNI_DEL requests.

With this patch, we do chroot in the child processes instead. So file operations in the main process will not be affected by chroot.

This change requires the multus thick plugin pod to mount CNI bin directory to the same path in the container host.

fixes https://issues.redhat.com/browse/OCPBUGS-18995

@coveralls
Copy link

coveralls commented Sep 22, 2023

Coverage Status

coverage: 63.087% (+0.4%) from 62.72% when pulling 4289741 on pliurh:chroot into 857d070 on k8snetworkplumbingwg:master.

@s1061123
Copy link
Member

Thank you so much for great PR, @pliurh ! Overall desgin makes sense to me.

One minor comments but this PR implicitly requires to manifest to mount CNI bin directory to same path in container host. (e.g. if /opt/cni/bin is the CNI bin directory, multus-daemon pod has to mount it with same path /opt/cni/bin, not /opt/bin.
Could you write down in thick-daemon manifest file https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/deployments/multus-daemonset-thick.yml?

@pliurh pliurh force-pushed the chroot branch 2 times, most recently from aa19590 to e0f3681 Compare September 22, 2023 07:42
@pliurh pliurh changed the title WIP: Move chroot from multus main process to its child processes Move chroot from multus main process to its child processes Sep 22, 2023
We used to run chroot in multus main process when calling other CNI
plugin binary. We also use a mutex to lock the access to pod files.
But this causes performance issues when facing heavy
CNI_ADD/CNI_DEL requests.

With this patch, we do chroot in the child processes instead. So
file operations in the main process will not be affected by chroot.

This change requires the multus thick plugin pod to mount CNI bin
directory to the same path in the container host.

Signed-off-by: Peng Liu <[email protected]>
@s1061123 s1061123 merged commit 1dd4edd into k8snetworkplumbingwg:master Sep 22, 2023
24 checks passed
pliurh added a commit to pliurh/multus-cni that referenced this pull request Sep 22, 2023
…rkplumbingwg#1161)

We used to run chroot in multus main process when calling other CNI
plugin binary. We also use a mutex to lock the access to pod files.
But this causes performance issues when facing heavy
CNI_ADD/CNI_DEL requests.

With this patch, we do chroot in the child processes instead. So
file operations in the main process will not be affected by chroot.

This change requires the multus thick plugin pod to mount CNI bin
directory to the same path in the container host.

Signed-off-by: Peng Liu <[email protected]>
@Deadpan110
Copy link

line 173 of deployments/multus-daemonset-thick.yml should be:

- name: cnibin
and not:
- name: cni-bin

kichankwon pushed a commit to kichankwon/multus-cni that referenced this pull request Nov 26, 2023
…rkplumbingwg#1161)

We used to run chroot in multus main process when calling other CNI
plugin binary. We also use a mutex to lock the access to pod files.
But this causes performance issues when facing heavy
CNI_ADD/CNI_DEL requests.

With this patch, we do chroot in the child processes instead. So
file operations in the main process will not be affected by chroot.

This change requires the multus thick plugin pod to mount CNI bin
directory to the same path in the container host.

Signed-off-by: Peng Liu <[email protected]>
s1061123 pushed a commit to s1061123/multus-cni that referenced this pull request Feb 21, 2024
…rkplumbingwg#1161)

We used to run chroot in multus main process when calling other CNI
plugin binary. We also use a mutex to lock the access to pod files.
But this causes performance issues when facing heavy
CNI_ADD/CNI_DEL requests.

With this patch, we do chroot in the child processes instead. So
file operations in the main process will not be affected by chroot.

This change requires the multus thick plugin pod to mount CNI bin
directory to the same path in the container host.

Signed-off-by: Peng Liu <[email protected]>
pliurh pushed a commit to pliurh/multus-cni that referenced this pull request May 21, 2024
OCPBUGS-18995: Move chroot from multus main process to its child processes (k8snetworkplumbingwg#1161)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants